# Maintainer: Caleb Maclennan <caleb@alerque.com>

pkgname=python-zipfile-deflate64
_pyname=${pkgname#python-}
pkgver=0.2.0
pkgrel=2
pkgdesc='Extract Deflate64 ZIP archives with Python’s zipfile API'
arch=(loong64 x86_64)
url="https://github.com/brianhelba/${_pyname}"
license=(Apache)
depends=(python)
makedepends=(python-{build,installer}
             python-setuptools-scm
             python-wheel)
# checkdepends=(python-pytest)
_archive="$_pyname-$pkgver"
# No tests in PyPi sources
source=("https://files.pythonhosted.org/packages/source/${_pyname::1}/$_pyname/$_archive.tar.gz")
# No version information in archive
# source=("$url/archive/v$pkgver/$_archive.tar.gz")
sha256sums=('875a3299de102edf1c17f8cafcc528b1ca80b62dc4814b9cb56867ec59fbfd18')

build(){
	cd "$_archive"
	python -m build -wn
}

# check() {
#     cd "$_archive"
#     local _pyver=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
#     export PYTHONPATH="$PWD/build/lib.linux-$CARCH-$_pyver"
#     python -m pytest tests
# }

package() {
	cd "$_archive"
	python -m installer -d "$pkgdir" dist/*.whl
}
